package com.qingzhuge.manager.security.token;

import com.qingzhuge.common.IBaseEnum;

/**
 * @author zeroxiao
 * @date 2019/9/12 21:31
 * @description
 */
public enum EnumTokenType implements IBaseEnum<Integer> {
    /**用户密码*/
    username(0),
    /**手机号*/
    mobile(1),
    /**邮箱*/
    email(2),
    /**微信*/
    wexin(3),
    /**QQ*/
    qq(4),
    /**支付宝*/
    alipay(5);

    private Integer value;

    EnumTokenType(Integer value) {
        this.value = value;
    }

    @Override
    public Integer value() {
        return value;
    }

    public static EnumTokenType get(String name) {
        if (name == null) {
            return null;
        }
        EnumTokenType[] vals = EnumTokenType.values();
        for (EnumTokenType e : vals) {
            boolean b = e.name().equals(name);
            if (b) {
                return EnumTokenType.valueOf(name);
            }
        }
        return null;
    }
}
